#pragma once




#ifndef SAFE_RELEASE
#define SAFE_RELEASE( x )  \
    if (NULL != x)      \
    {                   \
        x->Release();   \
        x = NULL;       \
    }
#endif

#ifndef SAFE_DELETE
#define SAFE_DELETE( x )  \
    if (NULL != x)      \
    {                   \
        delete x;       \
        x = NULL;       \
    }
#endif
#ifndef SAFE_ARRAY_DELETE
#define SAFE_ARRAY_DELETE( x )  \
    if (NULL != x)      \
    {                   \
        delete[] x;     \
        x = NULL;       \
    }
#endif
#ifndef BREAK_IF_FAILED
#define BREAK_IF_FAILED(hr) if(FAILED(hr)) break;
#endif
#ifndef RETURN_IF_FAILED
#define RETURN_IF_FAILED(hr) if(FAILED(hr)) return hr;
#endif

#ifndef RETURN_IF_FALSE
#define RETURN_IF_FALSE(ret) if(!ret) return ret;
#endif
